package io.cici.cc.mybatis.plus.core.enums;

import io.cici.cc.mybatis.plus.core.conditions.ISqlSegment;
import io.cici.cc.mybatis.plus.core.toolkit.StringPool;
import lombok.AllArgsConstructor;

/**
 * SQL 保留关键字枚举
 */
@AllArgsConstructor
public enum SqlKeyword implements ISqlSegment {
    AND("AND"), OR("OR"), NOT("NOT"), IN("IN"), NOT_IN("NOT IN"), LIKE("LIKE"), NOT_LIKE("NOT LIKE"),
    EQ(StringPool.EQUALS), NE("<>"), GT(StringPool.RIGHT_CHEV), GE(">="), LT(StringPool.LEFT_CHEV), LE("<="),
    IS_NULL("IS NULL"), IS_NOT_NULL("IS NOT NULL"), GROUP_BY("GROUP BY"), HAVING("HAVING"), ORDER_BY("ORDER BY"),
    EXISTS("EXISTS"), NOT_EXISTS("NOT EXISTS"), BETWEEN("BETWEEN"), NOT_BETWEEN("NOT BETWEEN"), ASC("ASC"),
    DESC("DESC");

    private final String keyword;

    @Override
    public String getSqlSegment() {
        return this.keyword;
    }
}
